var mongoose = require("../db.js");
var schema = mongoose.Schema; //模型生成器(表生成器)
//建立表 并且指定字段

// of ：用于定义数组中元素结构的属性。
// uuidv4 ：唯一id
var optionSchema = new schema({
    name: String,
    type: String,
    remark: String,
    createTime: String,
    updateTime: String,
    values: {
        type: Array,
        default: [],
        of: {
            label: String,
            value: String,
            remark: String,
            createTime: String,
            updateTime: String,
        },
    },
});

//转成数据模型导出
module.exports = mongoose.model("optioninfo", optionSchema);

